<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2024/7/22
 * Time: 9:37
 */

namespace app\logic\index\novel;


use app\common\lib\Common;
use app\common\lib\Oceanengine;
use app\logic\BaseLogic;
use support\Cache;

class OceanengineLogic extends BaseLogic
{
    protected $domain = 'https://ad.oceanengine.com/';

    protected static $instance;

    public function __construct()
    {
        parent::__construct();
    }

    public static function getInstance()
    {
//        if(is_object(self::$instance)){
//            return self::$instance;
//        }

        return  new self();
    }

    public function getTokenByAuthCode($authCode)
    {
        return Oceanengine::getInstance()->getTokenByAuthCode($authCode);
    }

    public function getOceanengineDetectionLink($param)
    {
        return $this->autoCreateTableAndInsertData(
            [
                'table'         => 'video_oceanengine_detection_link',
                'keyid'         => 'id',
                'attributes'    => $param,
            ]
        );
    }
}